import request from '@/utils/request'

// 查询课程列表
export function listCourse(query) {
  return request({
    url: '/system/course/list',
    method: 'get',
    params: query
  })
}
// 学生选课
export function listCourse1(query) {
  return request({
    url: '/system/course/list1',
    method: 'get',
    params: query
  })
}

// 老师选课
export function listCourse2(query) {
  return request({
    url: '/system/course/list2',
    method: 'get',
    params: query
  })
}

// 查询课程详细
export function getCourse(courseId) {
  return request({
    url: '/system/course/' + courseId,
    method: 'get'
  })
}

// 课程已选详细
export function getStudent(courseId) {
  return request({
    url: '/system/course/student/' + courseId,
    method: 'get'
  })
}

// 查询课程详细
export function th() {
  return request({
    url: '/system/course/th',
    method: 'get'
  })
}

// 新增课程
export function addCourse(data) {
  return request({
    url: '/system/course',
    method: 'post',
    data: data
  })
}

// 修改课程
export function updateCourse(data) {
  return request({
    url: '/system/course',
    method: 'put',
    data: data
  })
}

export function selCourse(data) {
  return request({
    url: '/system/course/choose',
    method: 'put',
    data: data
  })
}

// 删除课程
export function delCourse(courseId) {
  return request({
    url: '/system/course/' + courseId,
    method: 'delete'
  })
}



export function closeCourse(courseId) {
  return request({
    url: '/system/course/close/' + courseId,
    method: 'delete'
  })
}


// 导出课程
export function exportCourse(query) {
  return request({
    url: '/system/course/export',
    method: 'get',
    params: query
  })
}
